import request from '@/utils/request'
//查询数据
export function getcategories() {
    return request({
        url: '/categories'
    })
}

//查询指定数据
export function getcategory(id) {
    return request({
        url: `/categories/${id}`
    })
}
//增加接口
export function postCategories(data) {
    return request({
        url: '/categories',
        method: 'post',
        data
    })
}
// 带id的数据查询
export function editCategories(id) {
    return request({
        url: `/categories/${id}`,
    })
}
// 修改
export function editCategory(data) {
    return request({
        url: `/categories/${data.id}`,
        method: 'put',
        data
    })
}
//删除接口
export function delCategories(id) {
    return request({
        url: `/categories/${id}`,
        method: 'delete'
    })
}
// 获取分页总数
export function pgCategories(params) {
    return request({
        url: `/categories`,
        params
    })
}
